<?php
/**
 * 地区选择 widget
 * @example W('Area',array('curPro'=>1,'curCity'=>2,'area'=>3,'tpl'=>'loadCity'))
 * @author Jason
 * @version TS3.0
 */
class Area1Widget extends Widget {
	
    /**
     * @param integer curPro 当前省的ID
     * @param integer curCity 当前城市的ID
     * @param integer area 当前地区的ID
     * @param string  tpl 选用的地区选择模版 loadCity(链接方式) loadArea(文本框形式)
     */
	public function render($data) {
        $area=D('area')->where('pid=0')->order('sort asc')->select();
        $data['area']=$area;

        $data['proname']=D('Friend')->getAreaName( $data['curPro']);
        $data['cityname']=D('Friend')->getAreaName( $data['curCity']);
        $data['areaname']=D('Friend')->getAreaName( $data['curArea']);

        $content = $this->renderFile (dirname(__FILE__)."/".$data['tpl'].'.html', $data );
		return $content;
	}
	
	/**
	 * 渲染地区选择弹窗
	 */

}